#pragma once
#include<stdlib.h>
#include <string.h>
#include <vector> 
#include <string> 
#include <fstream> 
#include <iostream> 
#include <math.h>
#include <list>
#include "DirectoryEntry.h"
#include<memory>
#include<map>
#include <sstream>
using namespace std;
enum DirectoryEntryType
{
	Invalid = 0,
	Storage = 1,
	Stream = 2,
	Root = 5
};

typedef wchar_t WCHAR;
typedef unsigned int UINT32, UInt32;
typedef int INT32, Int32;
typedef unsigned short UINT16, UInt16, USHORT;
typedef unsigned long Int64;

class DirectoryEntry
{
public:
	DirectoryEntry(DirectoryEntry* parent, UInt32 entryID, string entryName, DirectoryEntryType entryType, UInt32 firstSectorID, UInt32 length);
	~DirectoryEntry();

	DirectoryEntryType EntryType() const { return _entryType; }
	void EntryType(DirectoryEntryType val) { _entryType = val; }
	UInt32 FirstSectorID() const { return _firstSectorID; }
	void FirstSectorID(UInt32 val) { _firstSectorID = val; }
	UInt32 Length() const { return _length; }
	void Length(UInt32 val) { _length = val; }
	std::vector<DirectoryEntry *> * Children() const { return _children; }
	void Children(std::vector<DirectoryEntry *> * val) { _children = val; }
	UInt32 EntryID() const { return _entryID; }
	void EntryID(UInt32 val) { _entryID = val; }
	std::string EntryName() const { return _entryName; }
	void EntryName(std::string val) { _entryName = val; }
public:
	void AddChild(DirectoryEntry *entry);
	DirectoryEntry * GetChild(string entryName);
private:
	UInt32 _entryID;
	string _entryName;
	DirectoryEntryType _entryType;
	UInt32 _firstSectorID;
	UInt32 _length;

	DirectoryEntry *_parent;
	vector<DirectoryEntry*> *_children;
};
